package com.bulemobi;

import android.app.Application;
import android.util.DisplayMetrics;
import com.bulemobi.activity.lock.view.LockPatternUtils;
import com.baidu.mapapi.SDKInitializer;
import com.bulemobi.util.ToastUtil;

public class App extends Application {
	private static App mInstance;
	private LockPatternUtils mLockPatternUtils;
    public static int DISPLAY_WID;//屏幕宽 width
    public static int DISPLAY_HEL; //屏幕高 height
    public static float DISPLAY_DEN; //屏幕密度 density

    public static App getInstance() {
		return mInstance;
	}

	@Override
	public void onCreate() {
		super.onCreate();
        SDKInitializer.initialize(getApplicationContext());
		mInstance = this;
		mLockPatternUtils = new LockPatternUtils(this);
        initParam();
        initTools();
	}

    private void initParam() {
        DisplayMetrics metrics = getResources().getDisplayMetrics();
        DISPLAY_WID = metrics.widthPixels;
        DISPLAY_HEL = metrics.heightPixels;
        DISPLAY_DEN = metrics.density;
    }

    private void initTools() {
        ToastUtil.init(getApplicationContext());
    }

	public LockPatternUtils getLockPatternUtils() {
		return mLockPatternUtils;
	}
}
